<div align="center" style="font-weight:bolder; font-size:14px;"><a href="<?php echo Utility::getSiteUrl(); ?>/album/addalbum">[Thêm album ảnh]</a></div>
<br /><br />
<?php
    if ($albums == null || count($albums) == 0){
     echo "<div style='position:relative; left:260px;'><font color=red>Chưa có album nào</font></div><br />";
    }
?>
<div id="main">
    <table>
        <tr>
        <?php $i = 0; foreach ($albums as $album){?>

            <td align="center" style="font-weight:bold;" width="150px">
                <a href='<?php echo Utility::getSiteUrl(); ?>/album/detail/<?php echo $album->id; ?>'>
                    <?php echo $album->name; ?>
                </a>
                <a onclick="return confirm('Bạn có chắc chắn muốn xóa album này không?');" href='<?php echo Utility::getSiteUrl(); ?>/album/deleteAlbum/<?php echo $album->id; ?>' style="font-weight:100;">[xóa]</a>
                <br />
                <a href='<?php echo Utility::getSiteUrl(); ?>/album/detail/<?php echo $album->id; ?>'>
                    <img src='<?php echo Utility::websiteRoot(); ?>/public/images/<?php echo (isset($album->thumbnail))?$album->thumbnail:"default.png"; ?>' alt='<?php echo $album->description; ?>' title='<?php echo $album->description; ?>' <?php if ($album->status==2) echo 'style="border: 4px solid red;"'; ?> />
                </a>
                <br /><br />
            </td>

        <?php
                $i++;
                if ($i%6 == 0)
                echo '</tr><tr>';
        } ?>
    </table>
</div>